﻿@model Google.YouTube.Video
@{
    
    Layout = "~/Views/Shared/_TwoColumnsLayout.cshtml";
}
<h2>@Model.Title</h2>
<object width="640" height="390">
    <param name="allowFullScreen" value="true"></param>
    <param name="allowScriptAccess" value="always"></param>
    <param name="movie"
         value="@string.Format("https://www.youtube.com/v/{0}?version=3&autoplay=1", @Model.VideoId)">
    </param>
    <param name="allowScriptAccess" value="always"></param>
    <embed src="@string.Format("https://www.youtube.com/v/{0}?version=3&autoplay=1", @Model.VideoId)"
         type="application/x-shockwave-flash"
         allowscriptaccess="always"
         allowfullscreen="true"
         width="640" height="390"></embed>
</object>
@if (Model.YouTubeEntry.YtRating != null)
{
    @Html.Partial("_Rating", Model.YouTubeEntry.YtRating)
}
<div class="viewCount">
    <span class="viewCountNumber">@Model.ViewCount.ToString("###,###,###")</span> Views
    <div>
        @Html.Partial("_SocialButtonsHorizontal")
    </div>
</div>
<h3>
    Video Information</h3>
<div class="description">
    @Html.Raw(Model.Description)
</div>
<h3>
    Tags:</h3>
@if (Model.Keywords != null)
{  
    <div class="tags">
        @foreach (var item in Model.Keywords.Split(new char[] { ',' }))
        {
            if (item != "Tags:" && !item.Contains("%"))
            {                
                if (item.Contains(" "))
                {
                    @Html.ActionLink(item, "Search", new { id = item.Trim().Replace(":", " ") })        
                }
                else
                {
                    @Html.ActionLink(item, "Search", new { id = HttpUtility.UrlPathEncode(item.Trim().Replace(":", " ")) })        
                }
            }
        }
        @Html.Partial("_TagsList", Model.Tags)
    </div>
}
<h3>
    Uploaded by:</h3>
<div class="uploader">
    @Html.ActionLink(Model.Uploader, "ShowLists", new { id = Model.Uploader })
    @if (ViewBag.UploaderProfile != null)
    {
        @Html.Partial("_UserProfile", (Google.GData.YouTube.ProfileEntry)ViewBag.UploaderProfile)
    }
    <span>On @Model.YouTubeEntry.Published</span>
    @Model.
</div>
<div class="videoComments">
    @if (Model.CommmentCount > 0)
    {   @Html.ActionLink("View All Comments", "Comments", new { id = Model.VideoId }, new { @class = "viewComments" })
        @Html.Partial("_Comments", ViewBag.Comments as Google.GData.Client.Feed<Google.YouTube.Comment>)
        @Html.ActionLink("View All Comments", "Comments", new { id = Model.VideoId })
    }
</div>
@*@Html.Partial("_SearchResults", ViewBag.BingResults as List<DDNY.WebPortals.Common.SearchResult>)
@if (ViewBag.TwitterResults != null)
{
    @Html.Partial("_Tweets", ViewBag.TwitterResults as List<LinqToTwitter.Search>)    
}*@ 